package string;

public class StringDemo extends Object{
    public static void main(String[] args) {
        String s1 = "Hellow";
        String s2 = "Hellow";
        String s3 = "Hellow";
        String s4 = new String("Hellow");

        System.out.println(s1==s2);
        System.out.println(s1==s3);
        System.out.println(s1==s4);

        String s = "Hello";
//        String ad = s;
//        s=s+"w";
        String s5 = s+"w";
        String s6 = "Hello"+"w";
//        System.out.println(ad==s);
        System.out.println(s == s5);
        System.out.println(s1 == s6);

        String s7 = "123abc";
        String s8 = new String("123abc");
        System.out.println(s7==s8);
        System.out.println(s7.equals(s8));

    }
}
